package com.eonmind.ai.service.impl;

import com.eonmind.ai.converts.AiChatConvert;
import com.eonmind.ai.dto.AiChatDto;
import com.eonmind.ai.mapper.AiModelMapper;
import com.eonmind.ai.service.IAiModelService;
import com.eonmind.common.contract.enums.StatusEnum;
import com.eonmind.common.provider.entity.ai.AiModel;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 模型服务实现类
 *
 * @author Xujie
 * @since 2025/5/7 20:36
 **/
@Slf4j
@Service
public class AiModelService implements IAiModelService {
    @Resource
    private AiModelMapper aiModelMapper;

    @Override
    public List<AiChatDto.AiModelData> listModelByKeyword(String keyword) {
        List<AiModel> aiModelList = aiModelMapper.selectByKeyword(keyword);
        return AiChatConvert.toAiModelDataList(aiModelList);

    }

    @Override
    public AiModel selectById(Long modelId) {
        return aiModelMapper.getValidModelById(modelId);
    }
}
